<?php
/**
 * Created by PhpStorm.
 * User: xk_96
 * Date: 2018/1/15
 * Time: 9:46
 */

namespace system\core;

use system\route\Route;

defined('WWW_ROOT') or die(header("HTTP/1.1 404 Not Found"));

class Controller
{
    public static function view($viewName, $data)
    {
        $viewPath = BASE_ROOT . '/app/view/' . $viewName . '.php';
        if (file_exists($viewPath)) {
            include $viewPath;
        } else {
            die("找不到视图文件: $viewName");
        }
    }
}